package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.WorkerMapper;
import com.ruoyi.system.domain.Worker;
import com.ruoyi.system.service.IWorkerService;
import com.ruoyi.common.core.text.Convert;

/**
 * 工人Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-23
 */
@Service
public class WorkerServiceImpl implements IWorkerService 
{
    @Autowired
    private WorkerMapper workerMapper;

    /**
     * 查询工人
     * 
     * @param workerId 工人主键
     * @return 工人
     */
    @Override
    public Worker selectWorkerByWorkerId(Long workerId)
    {
        return workerMapper.selectWorkerByWorkerId(workerId);
    }

    /**
     * 查询工人列表
     * 
     * @param worker 工人
     * @return 工人
     */
    @Override
    public List<Worker> selectWorkerList(Worker worker)
    {
        return workerMapper.selectWorkerList(worker);
    }

    /**
     * 新增工人
     * 
     * @param worker 工人
     * @return 结果
     */
    @Override
    public int insertWorker(Worker worker)
    {
        return workerMapper.insertWorker(worker);
    }

    /**
     * 修改工人
     * 
     * @param worker 工人
     * @return 结果
     */
    @Override
    public int updateWorker(Worker worker)
    {
        return workerMapper.updateWorker(worker);
    }

    /**
     * 批量删除工人
     * 
     * @param workerIds 需要删除的工人主键
     * @return 结果
     */
    @Override
    public int deleteWorkerByWorkerIds(String workerIds)
    {
        return workerMapper.deleteWorkerByWorkerIds(Convert.toStrArray(workerIds));
    }

    /**
     * 删除工人信息
     * 
     * @param workerId 工人主键
     * @return 结果
     */
    @Override
    public int deleteWorkerByWorkerId(Long workerId)
    {
        return workerMapper.deleteWorkerByWorkerId(workerId);
    }
}
